<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>知行合壹渐变焦点图</title>

    <style type="text/css">
        * {
            padding: 0;
            margin: 0;
            border: 0;
            list-style: none;
        }

        .box {
            width: 650px;
            height: 320px;
            border: 5px solid #000;
            margin: 100px auto;
            position: relative;
        }

        .box ul {
            z-index: 1;
            position: relative;

        }

        .box ul li {
            position: absolute;
            top: 0;
            left: 0;
        }

        .box img {
            width: 650px;
            height: 320px;
        }

        .box ol {
            z-index: 2;
            position: absolute;
            color: #fff;
            right: 10px;
            bottom: 10px;
        }

        .box ol li {
            width: 15px;
            height: 15px;
            text-align: center;
            line-height: 20px;
            float: left;
            padding: 5px;
            background: #ccc;
            margin-right: 2px;
        }

        .box ol .cur {
            background: #666;
            border: 1px solid #f40;
            margin-top: -1px;
        }
    </style>


    <script src="js/jquery.min.3.4.1.js"></script>


</head>

<body>

    <div class="box">

        <ol>
            <li class="cur">1</li>
            <li>2</li>
            <li>3</li>
            <li>4</li>
        </ol>

        <ul>
            <li><img src="images/01.webp" alt=""></li>
            <li><img src="images/02.webp" alt=""></li>
            <li><img src="images/03.webp" alt=""></li>
            <li><img src="images/04.webp" alt=""></li>
        </ul>


    </div>

    <script>
        $('ul li').eq(0).siblings().hide();
        $('ol li').mouseenter(function(){
            $(this).addClass('cur').siblings().removeClass('cur');
            var index = $(this).index();
            $('ul li').eq(index).show().siblings().hide();
        })
    
    </script>
</body>

</html>